#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2025/1/27 11:39
# @Author  : Ramsey
# @Site    : zh
# @File    : request.py
# @Software: PyCharm
from typing import Optional, Callable


class Request:
    def __init__(
            self,
            url: str,
            headers: Optional[dict] = None,
            callback: Optional[Callable] = None,
            priority: int = 0,
            method: str = "GET",
            cookies: Optional[dict] = None,
            proxy: Optional[dict] = None,
            data: Optional[dict] = None,
            encoding: str = "utf-8",
            meta: Optional[dict] = None,
    ):
        self.url = url
        self.headers = headers
        self.callback = callback
        self.priority = priority
        self.method = method
        self.cookies = cookies
        self.proxy = proxy
        self.data = data
        self.encoding = encoding
        self._meta = meta or {}

    def __lt__(self, other):
        return self.priority < other.priority

    @property
    def meta(self):
        return self._meta


if __name__ == "__main__":
    pass
